import { request, config } from 'utils'

const { api } = config
const { permissions } = api

export function getModals (params) {
  return request({
    url: permissions + '/modals',
    method: 'get',
    data: params,
  })
}

export function getButtons (params) {
  return request({
    url: permissions + '/buttons',
    method: 'get',
    data: params,
  })
}

export function getDatas (params) {
  return request({
    url: permissions + '/datas',
    method: 'get',
    data: params,
  })
}

export function addMembers (params) {
  return request({
    url: permissions + "/members",
    method: 'post',
    data: params,
  })
}

export function deleteMembers (params) {
  return request({
    url: permissions + "/members",
    method: 'delete',
    data: params,
  })
}

export function dataAuthorize (params) {
  return request({
    url: permissions + '/datas/authorize',
    method: 'post',
    data: params,
  })
}

export function buttonAuthorize (params) {
  return request({
    url: permissions + '/buttons/authorize',
    method: 'post',
    data: params,
  })
}

export function modalAuthorize (params) {
  return request({
    url: permissions + '/modals/authorize',
    method: 'post',
    data: params,
  })
}

export function remove (params) {
  return request({
    url: permissions + '/delete',
    method: 'post',
    data: params,
  })
}
